<?php
$id = $epg['id'];
$data = json_decode(file_get_contents('https://contenthub-api.eco.astro.com.my/channel/'.$id.'.json'));
$date = date('Y-m-d');
$data = $data->response->schedule->$date;
if($id == '49') {
    echo '<li><span>00:00&nbsp&nbsp&nbsp&nbspastro官網僅提供2021年節目表，無法提供最新節目表。</span></li>';
    exit();
};
for($i = 0; $i <= count($data) - 1; $i++) {
    echo '<li><span>'.preg_replace('/(.*?) /','',$data[$i]->datetime).'&nbsp&nbsp&nbsp&nbsp'.$data[$i]->title.'</span></li>';
};